﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

namespace blackhouse.Web {
    public static class UriExtension {
        public static string ConvertRelativeUrlToAbsoluteUrl(this Page page, string relativeUrl) {
            return string.Format("http{0}://{1}{2}",
                (page.Request.IsSecureConnection) ? "s" : "",
                page.Request.Url.Host,
                page.ResolveUrl(relativeUrl)
            );
        }
    }
}